package cn.ly.net;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class InetAddressDemo {
	public static void main(String[] args) throws UnknownHostException {
		InetAddress address = InetAddress.getByName("ly-84aae601d018");
		byte[] address1 = address.getAddress();
		String hostAddress = address.getHostAddress();
		String hostName = address.getHostName();
		
		for(byte b : address1){
			System.out.print(b);
		}
		System.out.println();
		for(int i=0; i < address1.length; i++){
			System.out.println(address1[i]);
		}
		System.out.println();
		System.out.println(hostAddress);
		System.out.println(hostName);
	}

}
